<?php
include 'db.php';

$username=trim($_GET['u']);
$q=mysql_query("SELECT (totalrating/ratingcount) FROM login WHERE `username`='{$username}'");

while($data = mysql_fetch_row($q))
echo $data[0];
mysql_close($link);
?>
